﻿@using Smart.Project.Data
@model MDepartment
@{
    Layout = null;
}
<link href="~/Content/css/styles.css" rel="stylesheet" />
<link href="~/Content/css/styles-blue.css" rel="stylesheet" />
<link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/css/new-styles.css" rel="stylesheet" />

<script src="~/Content/js/vendors/jquery/jquery.min.js"></script>
<script src="~/Content/js/vendors/bootstrap/bootstrap.min.js"></script>
<script src="~/Content/js/vendors/form/jquery.form.min.js"></script>
<script src="~/Content/js/vendors/form/jquery.validate.min.js"></script>
<script src="~/Content/js/vendors/slimScroll/jquery.slimscroll.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#slimScroll").slimScroll({
            height: "320px",
        });
        $.validator.addMethod("isPhone", function (value, element) {
            var length = value.length;
            var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;
            return this.optional(element) || (length == 11 && mobile.test(value));
        }, "请填写正确的手机号码");//可以自定义默认提示信息
        $("#ISVALID").val('@Model.ISVALID');
        $("#btnSave").click(function () {
            if ($("#mainForm").valid()) {
                $('#mainForm').ajaxSubmit(function (data) {
                    if (data == "true") {
                        parent.AlertInfo("编辑成功！", "success");
                    } else {
                        parent.AlertInfo("编辑失败！", "error");
                    }
                });
            }
        });
    });
</script>
<div class="powerwidget dark-red powerwidget-sortable" data-widget-editbutton="false" style="margin-bottom:0px">
    <div class="inner-spacer">
        <div id="slimScroll">
            @using (Html.BeginForm("Update", "Department", FormMethod.Post, new { @class = "form-horizontal", @id = "mainForm", @style = "margin-bottom:0px" }))
            {
                <fieldset>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">部门编码</label>
                        <div class="col-xs-10">
                            @Html.HiddenFor(item => item.Id)
                            @Html.HiddenFor(item => item.CREATETIME)
                            @Html.HiddenFor(item => item.UPDATETIME)
                            @Html.TextBoxFor(item => item.BMBM, new { @class = "form-control required", @readonly = "readonly" })
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">部门名称</label>
                        <div class="col-xs-10">
                            @Html.TextBoxFor(item => item.BMMC, new { @class = "form-control required", @readonly = "readonly" })
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">部门负责人</label>
                        <div class="col-xs-10">
                            @Html.TextBoxFor(item => item.MANAGER, new { @class = "form-control ", @readonly = "readonly" })
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">电话</label>
                        <div class="col-xs-10">
                            @Html.TextBoxFor(item => item.PHONE, new { @class = "form-control isPhone", @readonly = "readonly" })
                        </div>
                    </div>
                    @*<div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">部门人数</label>
                        <div class="col-xs-10">
                            @Html.TextBoxFor(item => item.EXTENDCODE, new { @class = "form-control digits", @readonly = "readonly" })
                        </div>
                    </div>*@
                    <div class="form-group">
                        <label class="col-xs-2 control-label" for="textinput">是否有效</label>
                        <div class="col-xs-10">
                            <select id="ISVALID" name="ISVALID" class="form-control" disabled="disabled">
                                <option value="1" selected="selected">有效</option>
                                <option value="0" selected="selected">无效</option>
                            </select>
                        </div>
                    </div>
                </fieldset>
            }
        </div>
    </div>
</div>


